-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v8.x backport] errors: make code property mutable #16078
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nodejs-github-bot
added
errors
Issues and PRs related to JavaScript errors originated in Node.js core.
v8.x
labels
Oct 8, 2017
3 tasks
evanlucas
approved these changes
Oct 9, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
MylesBorins
force-pushed
the
v8.x-staging
branch
from
October 11, 2017 06:06
9eb991a
to
6f42b68
Compare
jasnell
approved these changes
Oct 12, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but definitely needs a rebase following 8.7.0
Userland code can break if it depends on a mutable `code` property for errors. Allow users to change the `code` property but do not propagate changes to the error `name`. Additionally, make `message` and `name` consistent with `Error` object (non-enumerable). Test that `console.log()` and `.toString()` calls on internal `Error` objects with mutated properties have analogous results with the standard ECMAScript `Error` objects. PR-URL: nodejs#15694 Fixes: nodejs#15658 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
For internal errors, make `code` and `name` settable while keeping them non-own properties by default. PR-URL: nodejs#15694 Fixes: nodejs#15658 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Rebased. |
Trott
changed the title
[v8x backport] errors: make code property mutable
[v8.x backport] errors: make code property mutable
Oct 20, 2017
evanlucas
pushed a commit
that referenced
this pull request
Oct 23, 2017
Userland code can break if it depends on a mutable `code` property for errors. Allow users to change the `code` property but do not propagate changes to the error `name`. Additionally, make `message` and `name` consistent with `Error` object (non-enumerable). Test that `console.log()` and `.toString()` calls on internal `Error` objects with mutated properties have analogous results with the standard ECMAScript `Error` objects. Backport-PR-URL: #16078 PR-URL: #15694 Fixes: #15658 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
evanlucas
pushed a commit
that referenced
this pull request
Oct 23, 2017
For internal errors, make `code` and `name` settable while keeping them non-own properties by default. Backport-PR-URL: #16078 PR-URL: #15694 Fixes: #15658 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Userland code can break if it depends on a mutable
code
property forerrors. Allow users to change the
code
property but do not propagatechanges to the error
name
.Additionally, make
message
andname
consistent withError
object(non-enumerable). Test that
console.log()
and.toString()
calls oninternal
Error
objects with mutated properties have analogous resultswith the standard ECMAScript
Error
objects.Fixes: #15658
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
errors